/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Views;

import java.awt.BorderLayout;
import java.awt.Component;
import javax.swing.JFrame;

/**
 *
 * @author Joshua King
 */
public class SwingFacade {
     /**
     * It removes the component that is located in the border layout centre area
     */
    void setCenterPanel(JFrame view ,Component comp) {
        BorderLayout layout = (BorderLayout) view.getLayout();           
        if (layout.getLayoutComponent(BorderLayout.CENTER) != null) {
            view.remove(layout.getLayoutComponent(BorderLayout.CENTER));
        }
        view.add(comp, BorderLayout.CENTER);
    }

}
